<#assign pageAroundSize = 2/>

<div class="pagebar fr">
    <#assign fromLine = (pageDto.curPage - 1) * pageDto.pageSize + 1/>
    <#if fromLine < pageDto.totalCount >
        <#assign fromLine = fromLine/>
    <#else>
        <#assign fromLine = pageDto.totalCount/>
    </#if>
    <#assign toLine = pageDto.curPage * pageDto.pageSize/>
    <#if toLine < pageDto.totalCount >
        <#assign toLine = toLine/>
    <#else>
        <#assign toLine = pageDto.totalCount/>
    </#if>
    <span class="extend fl">显示 ${fromLine} - ${toLine} 条，共 ${pageDto.totalCount} 条</span>
    <ul class="pagination">
        <#if 1 < pageDto.curPage  >
        <li><a href="#;">1</a></li>
        </#if>
        <#if pageAroundSize + 2 < pageDto.curPage  >
        <li><span>...</span></li>
        </#if>
        <#assign fromPage = pageDto.curPage - pageAroundSize/>
        <#if fromPage < 2 >
            <#assign fromPage = 2/>
        <#else>
            <#assign fromPage = fromPage/>
        </#if>
        <#if fromPage <= pageDto.curPage - 1 >
            <#list fromPage..pageDto.curPage - 1 as i>
                <li><a href="#;">${i}</a></li>
            </#list>
        </#if>
        <li class="active"><span>${pageDto.curPage}</span></li>
        <#assign toPage = pageDto.curPage + pageAroundSize/>
        <#if pageDto.totalPage-1 < toPage >
            <#assign toPage = pageDto.totalPage-1/>
        <#else>
            <#assign toPage = toPage/>
        </#if>
        <#if pageDto.curPage + 1 <= toPage >
            <#list pageDto.curPage+1..toPage as i>
                <li><a href="#;">${i}</a></li>
            </#list>
        </#if>
        <#if pageDto.curPage < pageDto.totalPage - pageAroundSize - 1>
            <li><span>...</span></li>
        </#if>
        <#if pageDto.curPage < pageDto.totalPage >
            <li><a href="#;">${pageDto.totalPage}</a></li>
        </#if>
    </ul>
    <form class="navbar-form">
        <div class="form-group">
            <input type="text" class="form-control" placeholder="">
        </div>
        <button type="submit" class="btn btn-default">跳转</button>
    </form>
</div>